import request from '@/utils/request'
import { get } from 'sortablejs'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/getInfo',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'get'
  })
}

export function getInfoList() {
  return request({
    url: '/user/getInfoList',
    method: 'get'
  })
}

export function resetPwd(userId, password) {
  return request({
    url: '/user/updatePassword',
    method: 'POST',
    params: { userId: userId, password: password }
  })
}

export function deleteUser(userId) {
  return request({
    url: '/user/deleteUser',
    method: 'POST',
    params: { userId: userId }
  })
}

export function checkRegistered(userName) {
  return request({
    url: '/user/getIsRegistered',
    method: 'GET',
    params: { userName: userName }
  })
}

export function createOrUpdate(data) {
  return request({
    url: '/user/addOrUpdateUser',
    method: 'POST',
    data: data
  })
}

export function getUserPageInfos(data) {
  return request({
    url: '/user/getPageInfos',
    method: 'GET',
    params: data
  })
}

export function updateUserRoles(data) {
  return request({
    url: '/user/updateUserRoles',
    method: 'POST',
    data: data
  })
}


export function getStationSVG(){
  return request({
    url:'http://127.0.0.1:3007/iSTP.svg',
    method:get
  })
}


